package com.sz.biz.rpt.service.impl;

import com.sz.biz.rpt.entity.RptSaleProduct;
import com.sz.biz.rpt.service.RptSaleProductService;
import com.sz.common.base.service.AbstractService;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * Function: //TODO ADD FUNCTION. <br>
 * Date: 2017年12月05日 11:47 <br>
 * Author: wentao.chang
 */
@Service
public class RptSaleProductServiceImpl extends AbstractService implements RptSaleProductService {
    @Override
    public int save(RptSaleProduct rsa) {
        return dao.save("RptSaleProductMapper.insert", rsa);
    }

    @Override
    public int update(RptSaleProduct rsa) {
        return dao.update("RptSaleProductMapper.updateById", rsa);
    }

    @Override
    public int delete(int id) {
        return dao.delete("RptSaleProductMapper.deleteById", id);
    }

    @Override
    public RptSaleProduct findById(int id) {
        return (RptSaleProduct) dao.findForObject("RptSaleProductMapper.selectById", id);
    }

    @Override
    public void deleteByDate(Date dateBegin) {
        dao.delete("RptSaleProductMapper.deleteByDate", dateBegin);
    }

    @Override
    public List<RptSaleProduct> findByParam(Map<String, Object> param) {
        return dao.findForList("RptSaleProductMapper.findByParam", param, RptSaleProduct.class);
    }
}
